import {PlayerAction, MAX_PLAYER, MAX_HAND_CARD, INVALID_SEAT, Comb} from "./GameDefine";

export class GameData{
    handCards:Array<any>;
    outCards:Array<any>;
    action:Array<PlayerAction>;
    roundCurSeat:number;
    roundCurPower:number;
    preSeat:number;               //最后一个出牌玩家的座位号
    preComb:Comb;               //最后一个出牌的组合
    constructor(){
        this.reset();
    }

    reset(){
        this.handCards = new Array(MAX_PLAYER);
        this.outCards = new Array(MAX_PLAYER);
        for(let i=0;i<MAX_PLAYER;i++){
            this.handCards[i] = new Array(MAX_HAND_CARD).fill(0);
            this.outCards[i] = [];
        }
        this.action = new Array(MAX_PLAYER).fill(PlayerAction.NULL);
        this.roundCurSeat = INVALID_SEAT;
        this.roundCurPower = PlayerAction.NULL;
        this.preSeat = null;
        this.preComb = null;
    }

    resetRound(){
        this.preComb = null;
    }
}